
package com.scj.ho;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

public class FirstActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_first);
        Thread thread = new MyThread();
        thread.start();
    }

    private void myStart() {
        startActivity(new Intent(this, MainActivity.class));
        finish();
    }

    class MyThread extends Thread {
        @Override
        public void run() {
            try {
                sleep(2 * 1000);
                myStart();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

}
